//=============================================================================
#include "CApp.h"

//=============================================================================
void CApp::OnLoop() {
    //Calculate FPS
    CFPS::FPSControl.OnLoop();

    //--------------------------------------------------------------------------
    //Render Everything
    OnRender();

    NetworkEngine.OnLoop();

    //--------------------------------------------------------------------------
    char Buffer[255];
	sprintf(Buffer, "%s | FPS: %d", WCAPTION, CFPS::FPSControl.GetFPS());
    SDL_WM_SetCaption(Buffer, Buffer);

    //--------------------------------------------------------------------------
    /*if(Player) {
        std::string Packet = Player->Serialize();

        CNetworkStream::SendHeader(NetworkEngine.GetSocket(), CNETWORK_MESSAGE_UPDATE_PLAYER, Packet.size());
        CNetworkStream::SendString(NetworkEngine.GetSocket(), Packet);
    }else{
        if(NetworkEngine.PlayerID >= 0) {
            Player = &CPlayer::PlayerList[NetworkEngine.PlayerID];

            CLog::Notice("Got my Player ID = " + Stringify(NetworkEngine.PlayerID));

            Player->ID = NetworkEngine.PlayerID;
        }
    }*/
}

//==============================================================================
